import os
import wsgiref.handlers
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template as tpl

def render(self, template, values):
	path = os.path.join(os.path.dirname(__file__), 'templates/%s' % template)
	self.response.out.write(tpl.render(path, values))

def redirect(self, url):
	self.redirect(url)

def out(self,stri):
	self.response.out.write(stri)

def run(patterns, debug=True):
	application = webapp.WSGIApplication(patterns, debug=True)
	wsgiref.handlers.CGIHandler().run(application)
